import httpInstance from '@/utils/http'

//获取 banner 轮播图  1为首页轮播图默认是1 2为二级分类页轮播图
export function getBannerAPI(params = {}) {
  // 设置默认值为1，如果有参数传过来，则覆盖掉默认值
  const { distributionSite = '1' } = params
  return httpInstance({
    url: '/home/banner',
    params: {
      distributionSite
    }
  })
}

/**
 * @description: 获取新鲜好物
 * @param {*}
 * @return {*}
 */
export const findNewAPI = () => {
  return httpInstance({
    url: '/home/new'
  })
}

/**
 * * @description: 获取人气推荐
 * * @param {*}
 * * @return {*}
 * */
export const getHotAPI = () => {
  return httpInstance('home/hot')
}

/**
 * @description: 获取所有商品模块
 * @param {*}
 * @return {*}
 */
export const getGoodsAPI = () => {
  return httpInstance({
    url: '/home/goods'
  })
}
